package com.ljq.rpc.controller;

import com.alibaba.fastjson.JSONObject;
import com.ljq.rpc.common.pojo.testModel;
import com.ljq.rpc.common.pojo.testModel2;
import com.ljq.rpc.service.service;
import com.ljq.rpc.service.service2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class controller {

    @Autowired
    service service;

    @Autowired
    service2 service2;

    @RequestMapping("/test01")
    public String test01(){
        return (service.test01(1));
    }

    @RequestMapping("/test02")
    public String test02(){
        testModel model2 = service2.test03(new testModel2(1, "model2"));
        return JSONObject.toJSONString(model2);
    }
}
